const Service = require('egg').Service;

class SearchService extends Service {
  async select(keyword) {

    let resArt = await this.ctx.app.mysql.query(`select * from article where title like "%${keyword}%" or content like "%${keyword}%"`);
    let resBook = await this.ctx.app.mysql.query(`select * from book where title like "%${keyword}%" or description like "%${keyword}%"`);
    let res={
      bookList:resBook,
      articleList:resArt
    }
		return res
	}


}

module.exports = SearchService;